package dataLayer;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class DBconnect {
	public String url = "jdbc:mysql://martcor.nl:3306/deb42181_das2";
	public String user = "deb42181_das";
	public String password = "TpQeGc9m";

	public Connection conn = null;
	public Statement stmt = null;
	public ResultSet rs = null;
	public Boolean del = null;
	public Boolean ins = null;
	public PreparedStatement pst = null;

	// Method for closing the database connection
	public void closeConn() {
		try {
			conn.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

	// Method for opening a database connection.
	public void openConn() {
		try {

			conn = DriverManager.getConnection(url, user, password);

		} catch (SQLException err) {
			System.out.println(err.getMessage());

		}
	}

	public Connection getConn() {
		return conn;
	}

	public void setConn(Connection conn) {
		this.conn = conn;
	}
}
